package com.demon.androidbasic.widget

import android.content.Context
import android.view.View
import android.widget.FrameLayout
import android.widget.TextView
import com.demon.androidbasic.R

/**
 * 空数据文字提示
 */
class EmptyTextView(mContext: Context, txt: String, drawableResId: Int = 0) : FrameLayout(mContext) {
    init {
        val view = View.inflate(mContext, R.layout.empty_text_view, this)
        val txtNoData = view.findViewById<TextView>(R.id.txtNoData)
        txtNoData.text = txt
        if (drawableResId != 0) {
            txtNoData.setCompoundDrawablesWithIntrinsicBounds(0, drawableResId, 0, 0)
        }
    }
}